<template>
	<view>
		<cropper selWidth="660rpx" selHeight="660rpx" @upload="myUpload" :avatarSrc="imgurl" avatarStyle="width:100vw;height:100vw;"> 
		</cropper>
		  
		
	</view>
</template>

<script>
	import cropper from "@/pagesA/components/lxiaoxiao-cropper/lxiaoxiao-cropper.vue";
	// import jrAvatarClip from '@/uni_modules/jr-avatar-clip/components/jr-avatar-clip/jr-avatar-clip.vue'
	export default {
		data() {
			return {
				imgurl:'https://www.atuanjian.com/appletStatic/static/detail/add.png'
				 // avatar:'https://uhr-sit-1302914566.cos.ap-guangzhou.myqcloud.com/uhr/image/2022-03-08/b61a93d5-b12f-4b0b-8ace-0c7a8eadf6e7.png'
			}
		},
		components: {
		  cropper
		},
		methods: {
			// uploadHandle(e){
			//   console.log(e)
			// },
			// -------------------------------
			myUpload(rsp) {
			  const self = this;
			  self.imgurl = rsp.path; //更新头像方式一
			  uni.$emit('updateImg',self.imgurl)
			  uni.navigateBack({
				  delta:1
			  })
			  console.log(rsp)
			  // rsp.avatar.imgSrc = rsp.path; //更新头像方式二
			},
		},
		onLoad(option) {
			 
		}
	}
</script>

<style>

</style>
